package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.List;

/**用户实体类**/
@ApiModel(value = "用户实体类",description = "封装用户相关相关信息")
@TableName("t_user")
public class UserBean {
    /**用户编号**/
    @ApiModelProperty("用户编号")
    @TableId(value = "pk_userId",type = IdType.AUTO)
    private Integer id;
    /**用户名**/
    @ApiModelProperty("用户名")
    @TableField("u_username")
    private String username;
    /**密码**/
    @ApiModelProperty("密码")
    @TableField("u_password")
    private String password="111";
    /**盐**/
    @ApiModelProperty(hidden = true)
    @TableField("u_salt")
    private String salt;
    /**真实姓名**/
    @ApiModelProperty("真实姓名")
    @TableField("u_realName")
    private String realName;
    /**角色集合**/
    @ApiModelProperty(hidden = true)
    @TableField(exist = false)
    private List<RoleBean> roleList;
    /**权限集合**/
    @ApiModelProperty(hidden = true)
    @TableField(exist = false)
    private List<GradeBean> gradeList;

    public UserBean() {
    }

    public UserBean(String username, String realName) {
        this.username = username;
        this.realName = realName;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public List<RoleBean> getRoleList() {
        return roleList;
    }

    public void setRoleList(List<RoleBean> roleList) {
        this.roleList = roleList;
    }

    public List<GradeBean> getGradeList() {
        return gradeList;
    }

    public void setGradeList(List<GradeBean> gradeList) {
        this.gradeList = gradeList;
    }

    @Override
    public String toString() {
        return "UserBean{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", salt='" + salt + '\'' +
                ", realName='" + realName + '\'' +
                ", roleList=" + roleList +
                ", gradeList=" + gradeList +
                "}\n";
    }
}

